{% extends 'base.html' %}

{% block title %}{{ post.title }}{% endblock title %}

{% block content %}
    <h1>{{ post.title }}</h1>
    <span class="badge badge-primary">{{ post.timestamp }}</span> 
    <!-- 数据删除一般使用POST请求 -->
    <form action="{{ url_for('delete_post', post_id=post.id) }}" method="post">
        <input type="submit" value="删除文章" class="btn btn-danger btn-sm" id="delete_btn" onclick="return confirm('确定删除?')">   
    </form>
    <hr>

    <script>
        
    </script>

    <p>{{ post.body }}</p>
{% endblock content %}